
public class Type {            

        private String name;                        
        private Icon icon; 
        private Type t;  // I added this attribute to becomes a pointer .
                         // example when I have ?l type I store in the attribute Type = location.
        
        
        public Type () {              
        name = null;
        icon = null;

        }
        
        public Type (String name){
                this.name = name;
                icon = null ;
                t= new Type ();  // definition of the Object 
        }
        
       

		public Type (String nameOfType , Icon i ) {     
        name = nameOfType;
        icon = i;
        t= new Type ();
        }
        
        
        public void LinkTypeWithIcon(Icon i){  
                
        	this.icon = i;
        }
   
  public void display(){
    System.out.println("The name of the type is : <<" + getName()+">>" );
    System.out.println("The icon of the type is : " + getIcon() );
  }
  
  public void display2(){ // I added this method to use it in the class predicates .
	    System.out.println("The name of the type is : <<" + getName()+">>" +" -> of the Type : "+ getT().getName() );
	  }
        
        public void setName(String name) {
                this.name = name;
        }
        public void setIcon(Icon icon) {
                this.icon = icon;
        }
        

        public String getName() {
                return name;
        }

        public Icon getIcon() {
                return icon;
        }
        public void setT(Type t) {
			this.t = t;
		}
       

		public Type getT() {
			return t;
		}
        
        
}